package com.woniu.crowd.infra.model.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@Document(indexName = "crowdspu")
public class CrowdEsModel {
    /**
     * 众筹id
     */
    @Id
    private Integer id;
    /**
     * spu_id
     */

    @Field(type = FieldType.Integer, name = "spuId")
    private Integer spuId;

    /**
     * 商品名
     */
    @Field(type = FieldType.Text, name = "spuName")
    private String spuName;
    /**
     * 分类ID
     */
    @Field(type = FieldType.Integer, name = "categoryId")
    private Integer categoryId;


    /**
     * 分类名
     */
    @Field(type = FieldType.Text, name = "categoryName")
    private String categoryName;

    /**
     * 商品介绍
     */
    @Field(type = FieldType.Text, name = "introduction")
    private String introduction;

    /**
     * 头图
     */
    @Field(type = FieldType.Keyword, name = "spuMainPic")
    private String spuMainPic;

    /**
     * 销售统计
     */
    @Field(type = FieldType.Integer, name = "salesCount")
    private Integer salesCount;

    /**
     * 最低价格
     */
    @Field(type = FieldType.Double, name = "minPrice")
    private BigDecimal minPrice;

    /**
     * 最高价格
     */
    @Field(type = FieldType.Double, name = "maxPrice")
    private BigDecimal maxPrice;


//    /**
//     * 商品状态ON_SALE | OFF_SALE | DELETE 删除
//     */
//    @Field(type = FieldType.Text,name="spuStatus")
//    private String spuStatus;
    /**
     * 商品类别 正常 NORMAL | 众筹 CROWD | 甄选 SELECT
     */
//    @Field(type = FieldType.Text,name="spuType")
//    private String spuType;
//    /**
//     * 商品id
//     */
//    private Integer productId;

    /**
     * 众筹目标金额
     */
    @Field(type = FieldType.Double, name = "targetAmount")
    private BigDecimal targetAmount;

    /**
     * 当前已筹金额
     */
    @Field(type = FieldType.Double, name = "totalAmount")
    private BigDecimal totalAmount;

    /**
     * 当前参与众筹用户数
     */
    @Field(type = FieldType.Integer, name = "userCount")
    private Integer userCount;

    /**
     * 众筹开始时间
     */
    @Field(type = FieldType.Text, name = "startDate")
    private String startDate;

    /**
     * 众筹结束时间
     */
    @Field(type = FieldType.Text, name = "endDate")
    private String endDate;

    /**
     * 众筹状态( CREATED 已创建，CANCEL已取消，FINISH 已完成)
     */
    private String croedState;


}
